﻿using System.Reflection;

namespace Inovout.Resources
{
    internal class StringResourceLanguageVersion
    {
        private Assembly assembly;
        private string baseResourceName;
        private string language;

        internal StringResourceLanguageVersion(Assembly assembly, string baseResourceName, string language)
        {
            ArgumentGuard.IsNotNull(assembly, "assembly");
            ArgumentGuard.IsNotNullOrEmptyString(baseResourceName, "baseResourceName");
            ArgumentGuard.IsNotNullOrEmptyString(language, "language");
            this.assembly = assembly;
            this.baseResourceName = baseResourceName;
            this.language = language;

        }

        internal Assembly Assembly
        {
            get { return assembly; }
        }
        internal string BaseResourceName
        {
            get { return baseResourceName; }
        }
        internal string Language
        {
            get { return language; }
        }
        public override bool Equals(object thatResourceFileVersion)
        {
            StringResourceLanguageVersion that = thatResourceFileVersion as StringResourceLanguageVersion;

            return that==null?false:
                (assembly.Equals(that.Assembly)&baseResourceName.Equals(that.BaseResourceName)&language.Equals(that.Language));
        }

        public override int GetHashCode()
        {
            return assembly.GetHashCode() ^ baseResourceName.GetHashCode() ^ language.GetHashCode();
        }
    }
}
